<?php

namespace App\Admin\Actions\Grid;

use App\Admin\Forms\ClueFileUploadForm;
use App\Admin\Forms\ResetPassword as ResetPasswordForm;
use App\Models\Clue;
use Dcat\Admin\Widgets\Modal;
use Dcat\Admin\Grid\RowAction;

class ClueFileUploadAction extends RowAction
{
    protected $title = '<i class="feather icon-upload grid-action-icon" title="上传附件" style="color: #4c60a3;"></i>';

    public function render()
    {
        // 实例化表单类并传递自定义参数
        $id = $this->getKey();
        $files = $this->row("files");
        $form = ClueFileUploadForm::make()->payload(['id' => $id , 'files' => $files]);

        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body($form)
            ->button($this->title);
    }
}
